/*
 * File:   csNode.hpp
 * Author: gian
 *
 * Created on December 1, 2012, 6:33 PM
 */

#ifndef CSNODE_HPP
#define CSNODE_HPP

#include <list>

class csNode;


class csSegment;


typedef std::list<csSegment *> SegmentList;

class csSegment {
  public:
    csSegment();

    virtual ~csSegment();

    inline csNode * node1() {
      return n1;
    }

    ;
    inline csNode * node2() {
      return n2;
    }

    ;
    static csSegment * connect(csNode * n1,
                               csNode * n2);

    static SegmentList connections(csNode * n1,
                                   csNode * n2);

  protected:

  private:
    csNode * n1;
    csNode * n2;
};


class csNode {
  public:
    friend class csSegment;


    csNode();

    csNode(const csNode & orig);

    virtual ~csNode();

    csSegment * connection(const int i);

    csNode * connected_node(const int i);

    int connections();

    // friend csSegment *csSegment::connect(csNode* n1, csNode* n2);
    // friend SegmentList csSegment::connections(csNode* n1, csNode* n2);

  private:
    SegmentList mConnections;
};
#endif /* CSNODE_HPP */


//~ Formatted by Jindent --- http://www.jindent.com
